﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WCFTestApp.PushToDBService;
using System.Threading;



namespace WCFTestApp
{
    public partial class Form1 : Form
    {
        PushToDBServiceClient PushToDBServiceClientTemp = new PushToDBServiceClient();

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CreateCurrencyRequest CreateCurrencyRequestTemp = new CreateCurrencyRequest();
            CreateCurrencyRequestTemp.Name = textBox1.Text;

            label1.Text = PushToDBServiceClientTemp.CreateCurrency(CreateCurrencyRequestTemp).Status.ToString();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            CreateRateRequest CreateRateRequestTemp = new CreateRateRequest();
            CreateRateRequestTemp.Value = Convert.ToInt32(textBox2.Text);
            CreateRateRequestTemp.Period = Convert.ToDateTime(textBox3.Text);
            CreateRateRequestTemp.CurrencyName = textBox4.Text;

            label2.Text = PushToDBServiceClientTemp.AddCurencyRate(CreateRateRequestTemp);
        }

    }
}
